package com.weedsdream.function

import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale

/**long类型毫秒级时间戳转字符串
 * @param timestamp 时间戳
 * @param pattern 要转换的格式.注：ss-秒 SS-毫秒*/
fun longTime2String(
    timestamp: Long = System.currentTimeMillis(), pattern: String = "yy/MM/dd HH:mm"
): String = SimpleDateFormat(pattern, Locale.getDefault()).format(Date(timestamp))